webpackJsonp([4],{

/***/ 0:
/***/ function(module, exports, __webpack_require__) {

	var url = __webpack_require__(10);
	var template = __webpack_require__(11);
	var main = __webpack_require__(13);
	var form = __webpack_require__(20);
	var module = __webpack_require__(21);

	//模板配置
	var tplArr = [];
	var comisTpl = __webpack_require__(26);
	tplArr['comis'] = template.compile(comisTpl.replace(/^\s*|\s*$/g, ""));

	function Comis() {
	    _this = this;
	    this.main = function () {
	        main.event(this, 'tap', 'i-click');
	        this.init();
	    };
	    this.getContent = function () {
	        var data = {
	            tType: 'content',
	            select: module.getModule({ "fun": 'om-change="selectFun"', "list": [{ "name": "佣金排行榜", "value": "1" }, { "name": "佣金排行榜2", "value": "2" }], "selected": "1" }, 'baseSelect')
	        };
	        $(".content").html(tplArr['comis'](data));
	    };
	    this.getTab = function () {
	        var data = {
	            tType: 'table',
	            title: "8月佣金排行榜",
	            tabList: [{
	                name: "lily",
	                store: "福建中路店",
	                money: "1,230"
	            }, {
	                name: "lily",
	                store: "福建中路店",
	                money: "230"
	            }]
	        };
	        $(".month-comission").html(tplArr['comis'](data));
	    };
	    this.getTotal = function () {
	        var data = {
	            tType: 'table',
	            title: "佣金总排行榜",
	            tabList: [{
	                name: "lily",
	                store: "福建中路店",
	                money: "1,230"
	            }, {
	                name: "lily",
	                store: "福建中路店",
	                money: "230"
	            }, {
	                name: "lily",
	                store: "福建中路店",
	                money: "1,230"
	            }]
	        };
	        $(".total-comission").html(tplArr['comis'](data));
	    };
	    //下拉筛选
	    this.selectFun = function (ths) {
	        alert(ths.val());
	    };
	    this.init = function () {
	        this.getContent();
	        this.getTab();
	        this.getTotal();
	    };
	    return this.main();
	};

	var comis = new Comis();

/***/ },

/***/ 20:
/***/ function(module, exports, __webpack_require__) {

	var url = __webpack_require__(10);
	var template = __webpack_require__(12);
	var main = __webpack_require__(13);
	var modalTpl = __webpack_require__(18);

	//模板配置
	var tplArr = [];
	template.config('escape', false);
	tplArr['modal'] = template.compile(modalTpl.replace(/^\s*|\s*$/g, ""));

	//获取验证码
	function getCode(_dom, url, id) {
	  var _mobile = $('input[name="mobile"]').val();
	  var code = $('input[name="code"]').val();
	  if (_dom.text() != '获取验证码') {
	    return false;
	  }
	  if (_mobile == "") {
	    jsAlert('请输入手机号码');
	  } else if (/^1[3|4|5|7|8]\d{9}$/.test(_mobile) == false) {
	    jsAlert('手机号码格式有误');
	  } else {
	    _dom.text("校验中");
	    $.post(url, { "user_id": id, "mobile": _mobile }, function (json, textStatus) {
	      _json = json;
	      if (_json.code == 1) {
	        var tm = 60;
	        var tmr = setInterval(function () {
	          tm--;
	          if (tm > 0) {
	            _dom.text(tm + "秒");
	          } else {
	            _dom.text('获取验证码');
	            clearInterval(tmr);
	            tm = 60;
	            //_dom.attr('onclick','join.getCode()')
	          }
	        }, 1000);

	        jsAlert('验证码已发送');
	      } else if (_json.code == 2) {
	        jsAlert(_json.data);
	        _dom.text('获取验证码');
	      } else if (_json.code == 200) {
	        jsAlert(_json.data);
	        _dom.text('获取验证码');
	      }
	    }, 'json');
	  }
	}
	//弹窗
	function jsAlert(text, Fun) {
	  if (!Fun) {
	    Fun = 'm-click="modalAlertClose"';
	  }
	  var data = {
	    "type": "1",
	    "ico": 'warn',
	    "text": text,
	    "Callback": Fun
	  };
	  $('body').append(tplArr['modal'](data));
	}
	//表单数据整理
	// function ajaxSubmit_o(obj,module,but) {

	//   //var url = $(obj).attr("action") || window.location.href;
	//   var callback_name = $(obj).attr("callback");
	//   var url = $(obj).attr("action");
	//   var data = {};
	//   var ipts = {};
	//   $('input[name],textarea[name],select[name]',obj).each(function(item){
	//       var name = $(this).attr('name');
	//       var value = $(this).val();
	//       var ipt = $(this).attr('ipt');
	//       var isArray = /\[\]$/;
	//       if(isArray.test(name)){
	//           if(!data[name]){data[name]=[]}
	//           if(!ipts[name]){ipts[name]=[]}
	//           data[name].push(value);
	//           ipts[name].push(value,ipt);
	//       }else{
	//           data[name] = value;
	//           ipts[name] = [value,ipt];
	//       }
	//   });

	//   if(!yzForm(ipts)){return false;}
	//   but.attr('isSubmit','false').text('提交中...');
	//   $.ajax({
	//       url: url,
	//       type: "get",
	//       data: data,
	//       dataType: "json",
	//       success: function(ret){
	//           //if(ret.sms_success == "1"){
	//               //if(isNotEmpty(callback)) {
	//                 //_this.id = ret.success_id;
	//                 //jsConfirm('提示','请您确认所有填写的信息准确无误！',callback_name);
	//                 module[callback_name](ret);
	//               //}
	//           //}else if(ret.sms_success == "0"){
	//               //jsAlert("验证码错误");
	//           //}
	//       },
	//       error:function(ret){

	//       }
	//   });
	// }
	//表单数据整理
	function ajaxSubmit(obj, module, but) {
	  //console.info(module)
	  var but_val = but.html();
	  if (but_val == "提交中...") {
	    console.info("频次太快");
	    return false;
	  }
	  //var url = $(obj).attr("action") || window.location.href;
	  var callback_name = $(obj).attr("callback");
	  var url = $(obj).attr("action");
	  var formtype = $(obj).attr("f-type");
	  var data = {};
	  var ipts = {};
	  $('input[name],textarea[name],select[name]', obj).each(function (item) {
	    var name = $(this).attr('name');
	    var value = $(this).val();
	    var ipt = $(this).attr('ipt');
	    var isArray = /\[\]$/;
	    if (isArray.test(name)) {
	      if (!data[name]) {
	        data[name] = [];
	      }
	      if (!ipts[name]) {
	        ipts[name] = [];
	      }
	      data[name].push(value);
	      ipts[name].push(value, ipt);
	    } else {
	      data[name] = value;
	      ipts[name] = [value, ipt];
	    }
	  });

	  if ($("input[name='is_default']:checked").length == 1) {
	    data.is_default = 1;
	  } else {
	    data.is_default = 0;
	  }

	  if (!yzForm(ipts)) {
	    return false;
	  }
	  but.attr('isSubmit', 'false').html('提交中...');

	  //console.info(data)
	  data.openid = openid;
	  // $("body").html(data.serverId);
	  $.ajax({
	    url: url, //+"?openid_test=ojtKJjq93sF3dOoz4lA12MrxtcUk",
	    type: "post",
	    data: data,
	    dataType: "json",
	    success: function (ret) {
	      // console.info(ret)
	      //if(ret.sms_success == "1"){
	      //if(isNotEmpty(callback)) {
	      //_this.id = ret.success_id;
	      //jsConfirm('提示','请您确认所有填写的信息准确无误！',callback_name);
	      module[callback_name](ret);
	      but.html(but_val);
	      //}
	      //}else if(ret.sms_success == "0"){
	      //jsAlert("验证码错误");
	      //}
	    },
	    error: function (ret) {
	      but.html(but_val);
	      console.info(ret);
	    }
	  });
	}
	//方法验证
	function yzForm(data) {
	  var Ctrue = true;
	  var hour = $('select[name="sendplan_hour"]').val();
	  for (ipt in data) {
	    if (data[ipt][1] == 'true') {
	      continue;
	    }
	    switch (ipt) {

	      case 'name':
	        if (data[ipt][0] == "") {
	          isCtrue('请输入名字');return false;
	        }
	        break;

	      case 'mobile':
	        if (data[ipt][0] == "") {
	          isCtrue('请输入手机号码');return false;
	        } else if (/^1[3|4|5|7|8]\d{9}$/.test(data[ipt][0]) == false) {
	          isCtrue('手机号码格式有误');return false;
	        }
	        break;

	      case 'address':
	        if (data[ipt][0] == "") {
	          isCtrue('请输入详细地址');return false;
	        }
	        break;
	      case 'shipping_id':
	        if (data[ipt][0] == "") {
	          isCtrue('请选择物流');return false;
	        }
	        break;
	      case 'shipping_number':
	        if (data[ipt][0] == "") {
	          isCtrue('请填写物流单号');return false;
	        }
	        break;

	      // case 'is_default':
	      //    if(data[ipt][0]==""){isCtrue('请选择');return false;}
	      // break;
	    }
	  }
	  function isCtrue(text) {
	    Ctrue = false;
	    main.alert({
	      "title": "提示",
	      "content": text
	    });
	  };
	  return Ctrue;
	}

	exports.getCode = getCode;
	exports.jsAlert = jsAlert;
	exports.ajaxSubmit = ajaxSubmit;
	exports.yzForm = yzForm;

/***/ },

/***/ 26:
/***/ function(module, exports) {

	module.exports = "{{if tType == 'content'}}\n{{select}}\n<div class=\"table-item month-comission\"></div>\n<div class=\"table-item total-comission\"></div>\n{{/if}}\n{{if tType=='table'}}\n<p class=\"table-desc\">{{title}}</p>\n<div class=\"table-block\">\n    <table class=\"ui-table ui-border-tb\">\n        <thead>\n        <tr><th>排名</th><th>姓名</th><th>门店</th><th>佣金额</th></tr>\n        </thead>\n        <tbody>\n        {{each tabList as v i}}\n            <tr><td>{{i+1}}</td><td>{{v.name}}</td><td>{{v.store}}</td><td>￥{{v.money}}</td></tr>\n        {{/each}}\n        </tbody>\n    </table>\n</div>\n{{/if}}"

/***/ }

});